<%--
  Created by IntelliJ IDEA.
  User: Andy Lu
  Date: 2015/12/4
  Time: 17:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="include.js.jsp" %>

<%--<script src="../../../static/js/index.js" type="text/javascript"></script>--%>
<script type="text/javascript">
    var nid = 0;
    $(function () {
        $("#nav").tree({
            url: '${pageContext.request.contextPath}/tree/list.do?nid=0',
            lines: true,
            onBeforeExpand: function (node, param) {
                $('#nav').tree('options').url = '${pageContext.request.contextPath}/tree/list.do?nid=' + node.id;// change the url

            },
            onLoadSuccess: function (node, data) {
                if (data) {
                    $(data).each(function (index, value) {
                        if (this.state == 'closed') {
                            $('#nav').tree('expandAll');
                        }
                    });
                }
            },
            onClick: function (node) {
                if (node.url) {
                    if ($('#tabs').tabs('exists', node.text)) {
                        $('#tabs').tabs('select', node.text);
                    } else {
                        $('#tabs').tabs('add', {
                            title: node.text,
                            iconCls: node.iconCls,
                            closable: true,
                            href: '${pageContext.request.contextPath}' + node.url,
                        });
                    }
                }
            }
        });

        $("#cc").layout();
        $("#tabs").tabs({
            fit: true,
            border: false
        });
    });
</script>
<html>
<head>
    <title>首页</title>

</head>
<body>
<div id="cc" style="width:100%;height:100%;">
    <!--顶部-->
    <div data-options="region:'north',border:false,split:true,noheader:true,split:true">
    </div>
    <!-- 底部 -->
    <div data-options="region:'south',noheader:true,split:true" style="height:35px;line-height: 30px;text-align: center">
        &copy;2015-2016 XXX(中国)俱乐部 .Powered by Andy.
    </div>
    <!-- 左侧-->
    <div data-options="region:'west',title:'导航',split:true" style="width:180px;">
        <ul id="nav"></ul>
    </div>
    <!---中部-->
    <div data-options="region:'center'">
        <div id="tabs">
            <div title="起始页" style="padding:0 10px;dispaly:block;">
                欢迎来到后台管理系统
            </div>
        </div>
    </div>
</div>
</body>
</html>
